<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>彩矿家 - 登录</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" type="text/css" media="screen" href="__PUBLIC__/style/reset.css" />
  <link rel="stylesheet" type="text/css" media="screen" href="__PUBLIC__/style/login.css" />
  <link rel="stylesheet" href="__PUBLIC__/libs/pop-modal/popModal.css" />
</head>

<body>
  <div class="container">
    
    <include file="./Application/Home/View/Index/inc/header.html" />

    <div class="content">
      <div class="login-wrapper">
        <form id="login-form" action="{:U('login')}" method="POST">
          <div class="login-title">
            <span class="left active">登陆</span>
            <span class="pointer" id="switch-register">注册</span>
          </div>
          <div class="login-input">
            <input name="username" type="text" placeholder="输入手机号">
          </div>
          <div class="login-input last">
            <input name="password" type="password" placeholder="输入密码">
          </div>
          <div class="btn-wrap">
            <p class="pointer" id="submit-login">登陆</p>
          </div>
        </form>
      </div>
      <div class="register-wrapper hide">
        <form id="register-form" action="{:U('register')}" method="POST">
          <div class="login-title">
            <span class="left pointer" id="switch-login">登陆</span>
            <span class="active">注册</span>
          </div>
          <div class="login-input">
            <input name="username" type="text" placeholder="输入手机号">
          </div>
          <div class="login-input">
            <input name="password" type="password" placeholder="输入密码">
          </div>
          <div class="login-input last">
            <input name="repassword" type="password" placeholder="再次输入密码">
          </div>
          <div class="btn-wrap">
            <p class="pointer" id="submit-register">注册</p>
          </div>
        </form>
      </div>
    </div>
    
    <include file="./Application/Home/View/Index/inc/footer.html" /> 
  </div>
  <!-- dialog -->
  <div id="content" >
    请输入手机号码
    <div class="popModal_footer">
      <button type="button" data-popModalBut="ok">ok</button>
      <button type="button" data-popModalBut="cancel">cancel</button>
    </div>
  </div>
</body>
<script src="__PUBLIC__/libs/jquery.min.js"></script>
<script src="__PUBLIC__/libs/pop-modal/popModal.js"></script>
<script>
  $(function () {
    // 显示注册
    $('#switch-register').on('click', function () {
      $('.register-wrapper').removeClass('hide');
      $('.login-wrapper').addClass('hide');
    })

    // 显示登陆
    $('#switch-login').on('click', function () {
      $('.login-wrapper').removeClass('hide');
      $('.register-wrapper').addClass('hide');
    })

    // 登陆
    $('#submit-login').on('click', function () {
      console.log('login');
      var f = $('#login-form')[0]
      f.submit()
      // $('#content').dialogModal({
      //   onOkBut : function(){
      //     console.log('ok');
      //   },
      //   onCancelBut : function(){},
      //   onLoad : function(){},
      //   onClose : function(){},
      // });
    })
    

    // 注册
    $('#submit-register').on('click', function () {
      console.log('register');
      var f = $('#register-form')[0]
      f.submit()
    })
  });
</script>
</html>